home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d27 / ebl_401.arc / BATDEMO.BAT < prev    next >
DOS Batch File  |  1990-08-01  |  17KB  |  519 lines

  1. bat * Loading DEMO .....
  2. *           Written by F.Canova 10/5/83 through 01/25/90
  3. *   (c) Copyright 1983-1990 by Seaware Corp. all rights reserved.
  4. *    This batch file REQUIRES EBL PLUS for proper execution!
  5.  
  6. ********************* NOTE! NOTE! NOTE! NOTE! ********************
  7. %D = 'RAM'    |* <-----Change 'RAM' to 'BIOS' if PC isn't 100% IBM Compatible!
  8. goto -start
  9. * For more information or to receive your own copy of EBL PLUS write to:
  10. *              Seaware Corp.
  11. *              P.O. Box 1656
  12. *              Delray Beach, FL 33444
  13.  
  14. *---- FEATURES OF THE LANGUAGE USED WITHIN THIS DEMO ARE: ----------------
  15. * Standard DOS commands can be intermixed freely with BAT commands.
  16. * Up to 255 chars are allowed for labels, contents of vars, and literals
  17. * 10 variables are provided to be passed to/from DOS. They're %0 to %9.
  18. * 15 variables are provided for EBL PLUS┐ user use only. They're %A to %O.
  19. * The variable %R is a return code that any routine can set at [0:04FE]
  20. * BEGTYPE command can have screen attributes via the COLORCHAR command,
  21. * or the '\hex' format.
  22. * BEGSTACK command can have timing attributes via the KEY(PAUSE) or
  23. * the alternative '\hex' format.
  24. * Spaces are not needed to delimit operators.
  25. * Non-spaces will concatenate variables and literals.
  26. * EXIST() and DIR() set a return code based on state of a file's existence.
  27.  
  28.         ** Now actually do the bouncing bar menu **
  29. -End1    type " Exit to DOS                " | If %A = Enter then goto -Bye
  30. -Endit    %A = select( color( yellow on blue), color( black on white ), Arrow)
  31.     if %A = Esc then goto -line0
  32.     if %R = 1 then goto -End1
  33. -End2    if %R = 2 type " Go to on-line documentation" | If %A = Enter then stack "BATDOC" |exit
  34. -End3    if %R = 3 type " Return to EBL Plus demo    " | If %A = Enter then goto -top
  35.        goto -endit
  36.  
  37. -Bye    window( 19, 14, 49, 21)
  38.     type "So long" %F....
  39.     type "P.S. For quickie help,"
  40.     type " just enter 'BAT' from DOS!"
  41.     exit
  42.  
  43. -start
  44.     if %D = 'RAM' then RAM
  45.     else BIOS
  46.  
  47. ** Open the demo with welcome message windows in the shape of a big 'W' **
  48. *   play( o5 t140 ms l8 g4 p >c <b >c p6 <e p6 d p6 b p6 >c..)
  49. *   repeat with %0 = 1 to 27
  50. *    color ((%0 % 8) & "F")
  51. *    if %0 < 7        then %1 = %0 * 2
  52. *       else if %0 < 14  then %1 = (14 - %0) * 2
  53. *       else if %0 < 21  then %1 = (%0 - 13) * 2
  54. *       else          %1 = (28 - %0) * 2
  55. *    window( (%0*2), %1, (%0*2+20), (%1+5), s)
  56. *    type
  57. *    type center("Welcome", 18)
  58. *   end repeat
  59. *   wait until time(2)
  60.  
  61. ** Start by asking who I'm talking to **
  62.     colorchar '=' as color( yellow on white )
  63.     colorchar '@' as color( white on blue )
  64.     colorchar '`' as color( blink white on blue )
  65.     color( black on white )
  66.     cls
  67.     begtype
  68.           =(Non-IBM systems, read NOTE within this file)=
  69.  
  70.   @┌───────────────────────────────────────────────────────────────────────┐@
  71.   @│          EXTENDED BATCH LANGUAGE-PLUS                   │@
  72.   @│                                       │@
  73.   @│    Welcome to the Extended Batch Language Plus Demonstration !       │@
  74.   @│                                       │@
  75.   @└───────────────────────────────────────────────────────────────────────┘@
  76. end
  77. call -asplogo 40 16
  78. color( white on black )
  79. locate 13 10 | Type "What is your first name? ;"
  80. read %F
  81. %7 = 27
  82. %L =
  83. %0 = left( (" " & %F & "'s EBL Plus Sampler Menu"), 47)
  84.  
  85. -top ** Show Master Menu of things that can be shown **
  86.     color( Normal )
  87.     colorchar
  88.     colorchar '@' as color( white on blue )
  89.     colorchar '^' as color( lgray on blue )
  90.     colorchar '#' as color( black on cyan )
  91.     colorchar '&' as color( yellow on red )
  92.     colorchar '*' as color( white on red )
  93.     cls begtype
  94. @════════════════════════════════════════════════@ ^┌─────────────────────────┐^
  95. @ \%0@ ^│ User supported software │^
  96. @════════════════════════════════════════════════@ ^│           by          │^
  97.                            ^│                  │^
  98.                            ^│ Seaware Corp.          │^
  99.  # C #────&I can Count                 & ^│ P.O. Box 1656          │^
  100.       *                     * ^│ Delray Beach, FL 33444  │^
  101.  # D #────&Directory of available programs     & ^│ 407/392-2046          │^
  102.       *                     * ^│                  │^
  103.  # F #────&Testing for Files             & ^│ Order your registered   │^
  104.       *                     * ^│ copy for $79 from us    │^
  105.  # K #────&Keyboard stack (the invisible fingers)& ^│ directly or our order   │^
  106.       *                     * ^│ line at 800/634-8188    │^
  107.  # S #────&Display Screen and String operations  & ^│                  │^
  108.       *                     * ^│ Please copy and share   │^
  109.  # X #────&eXit                  & ^│ BAT.COM, BATDOC.BAT,    │^
  110.                            ^│ and BATDEMO.BAT for     │^
  111.                            ^│ non-commercial uses     │^
  112.                            ^│ only.              │^
  113.                            ^│                  │^
  114.                            ^│ ASP member.          │^
  115. (Select a demo with the cursor and press ─┘)       ^└─────────────────────────┘^
  116. end
  117.     colorchar
  118.     colorchar '@' as color( white on blue )
  119. -Entry
  120.     color( yellow on black)
  121.     %9 = ''
  122.  
  123. -Text.1 *** (C)ount
  124.     locate 1 18
  125.     type " This is a simple game that shows the math    "
  126.     type " and looping capabilities of EBL Plus.        "
  127.     if %9 = Enter then call -i.can.count | goto -top
  128.  
  129. -Choose
  130.     %7 = %7 + 3
  131.     %9 = select(color(yellow on red),color(black on white),Arrow)
  132.  
  133.     if %9 = 'C' then %9 = Enter
  134.     if %9 = 'D' then %9 = Enter
  135.     if %9 = 'F' then %9 = Enter
  136.     if %9 = 'K' then %9 = Enter
  137.     if %9 = 'S' then %9 = Enter
  138.     if %9 = 'X' then %9 = Enter
  139.     locate 1 18
  140.     if %R = 1 then goto -Text.1
  141.     if %R <> 2 then skip 4
  142.     type " See how EBL Plus can work together with your "
  143.     type " application and DOS.                         "
  144.     if %9 = Enter then call -dgo | goto -top
  145.           else goto -Choose
  146.     if %R <> 3 then skip 4
  147.     type " EBL Plus can see files that are created by   "
  148.     type " your programs, or create new ones on it own. "
  149.     if %9 = Enter then call -fgo | goto -top
  150.           else goto -Choose
  151.     if %R <> 4 then skip 4
  152.     type " EBL Plus can automatically control your      "
  153.     type " applications by typing on the keyboard.      "
  154.     if %9 = Enter then call -kgo | goto -top
  155.           else goto -Choose
  156.     if %R <> 5 then skip 4
  157.     type " See how EBL Plus makes your screen come alive"
  158.     type " with color and powerful string handling.     "
  159.     if %9 = Enter then call -sgo | goto -top
  160.           else goto -Choose
  161.     else
  162.     type " Leave this Demo and return to DOS            "
  163.     type "                                              "
  164.     if %9 = Enter then goto -exit
  165.           else goto -Choose
  166.  
  167. *******************************************************************************
  168.  
  169. * number guessing demo *
  170. -i.can.count
  171.     cls type "I am thinking of a two digit number, can you guess it?"
  172.     %J=tries
  173.     %7 = right(%7,2) + 0        |* Limit to just 2 digits!
  174.     repeat with %A = 4 down to 0
  175.     read %5
  176.     if %5 = %7
  177.     begin
  178.         type "Great!  I was afraid you weren't going to get it!"
  179.         exit repeat
  180.     end
  181.     if %A = 1 then %J = try
  182.     if %A = 0
  183.     begin
  184.         type "BOO HISSS!  The number was" %7 "!"
  185.         exit repeat
  186.     end
  187.     if %5 > %7 type "Try a little lower.  You get" %A "more" %J.
  188.     if %5 < %7 type "Try a higher number.  You get" %A "more" %J.
  189.     end repeat
  190.     begtype
  191. @════════════════════════════════════════════════════════════════════════════@
  192.   A BAT program can create loops and count events.  With this you can
  193.   sequence through file numbers, or create loops to do retries in case of
  194.   errors.  The REPEAT commands are handy for this.  EBL programs can even
  195.   do arithmetic (up to 18 digits) and string manipulation (up to 255
  196.   characters mixed case).  In addition, the external function BATMATH3,
  197.   (or alternate BATMATH87 for use with the 8087 co-processor) is provided
  198.   to registered users when floating point math is needed.
  199. @════════════════════════════════════════════════════════════════════════════@
  200.  
  201. Press any key to continue. . .
  202.  
  203. end
  204. inkey
  205. return
  206.  
  207. *******************************************************************************
  208.  
  209. * directory demo *
  210. -dgo
  211.     color( White )
  212.     cls
  213.     type "Enter file.spec for files you would like to see,"
  214.     read or press ENTER for all: %1
  215.     if .%1 = '.' then %1 = '*.*'
  216.     -dirques
  217.     colorchar . as color( yellow on black )
  218.     type "Would you like a .S.tandard or .W.ide directory?"
  219.     select( color(yellow on black))
  220.     colorchar .
  221.     if %R = 2 then %3 = '/w'
  222.        else %3 =
  223.     cls
  224.     type "EBL Plus can work directly with your applications or DOS."
  225.     type "For example, two values are passed to DOS here: %1 and %3"
  226.     shell dir %1 %3 /p
  227.     shell pause
  228.     cls
  229.     begtype
  230. @═════════════════════════════════════════════════════════════════════════@
  231.   This directory was created using the 'DIR' DOS command within this
  232.   batch file.  Any DOS commands can be mixed freely within lines of the
  233.   BAT program and are shelled by default.  Here, to insure EBL understood
  234.   it to be a DOS command, rather than it's own 'DIR' command, another
  235.   'SHELL' was placed before the DOS command.  Alternately, the 'LEAVE'
  236.   command could have been used.  By passing parameters to and from DOS,
  237.   you can have complete control of how a program operates.  User programs
  238.   may also set a return code in order to control batch file execution.
  239. @═════════════════════════════════════════════════════════════════════════@
  240.  
  241. Press any key to continue. . .
  242.  
  243. end
  244. inkey
  245. return
  246.  
  247. *******************************************************************************
  248.  
  249. *files demo
  250. -fgo
  251.     cls type Enter a file name to search.
  252.     read %E
  253.     -is.f if .%E = '.' then goto -fgo
  254.     type Scanning for file: %E . . .
  255.     * this will set the return code up (%R)
  256.     if exist( %E ) then type The file does exist - exactly as typed.
  257.     else
  258.     begin
  259.      type The file does not exist in the current subdirectory.
  260.      -srch
  261.          type Would you like to search another subdirectory
  262.          read or drive (y/n)? %B
  263.          if %B <> y then if %B <> n goto -srch
  264.          if %B <> y then cls | skip 5
  265.      -is.f2
  266.          cls type "Enter path and filename (ex. c:\subdir\filename.ext):"
  267.          read %E
  268.          if .%E = '.' then goto -is.f2
  269.          goto -is.f
  270.     end
  271.     begtype
  272.  
  273. @═══════════════════════════════════════════════════════════════════════════@
  274.       File searching is done by the commands called DIR and EXIST.
  275.  
  276.   If the file was there, we could direct a program to use it, even if it
  277.   wasn't on the specific diskette drive that the operator was expecting.
  278.  
  279.   If the file was not there, we could have printed out an error message
  280.   to the operator, or we could have run an alternate program in order to
  281.   create the missing file.
  282.  
  283.   Extended Batch Language Plus┐ can also read and write files.    This is
  284.   useful for making configuration files, setting up printers, etc.
  285. @═══════════════════════════════════════════════════════════════════════════@
  286.  
  287. Press any key to continue . . .
  288.  
  289. end
  290. inkey
  291. return
  292.  
  293. *******************************************************************************
  294.  
  295. * keyboard stack demo
  296. -kgo
  297. cls begtype
  298.  
  299. ╔═════════════════════════════════════════════════════════════════════════════╗
  300. ║                                          ║
  301. ║    The keyboard stack can answer questions to programs automatically.       ║
  302. ║    For example, this DOS command is being answered by the keyboard stack.   ║
  303. ║                                          ║
  304. ╚═════════════════════════════════════════════════════════════════════════════╝
  305. end
  306. begstack
  307. This text is actually being typed for you from the keyboard stack.
  308. All keys, including control keys and function keys can come from this stack.
  309. end
  310.     key( "Keystrokes can" )
  311.     key(pause)
  312.     key( " even" )
  313.     key(pause)
  314.     key( " have" )
  315.     key(pause)
  316.     key( " delayed" )
  317.     key(pause)
  318.     key( " typing. " )
  319.     Key(ctrl-z)
  320.     key(enter)
  321.     stack.on  |* This makes sure copy can see our stack contents.
  322.     * Below is the DOS command that will read the keyboard stack. *
  323. copy con: nul:
  324. begtype
  325.  
  326. Press any key to continue. . .
  327.  
  328. end
  329. inkey
  330. return
  331.  
  332. *******************************************************************************
  333. * screen attributes and strings demo
  334. -sgo
  335. colorchar '^' as color( high-intensity on black )
  336. colorchar '~' as color( red on black )
  337. colorchar '`' as color( blue on green )
  338. colorchar '&' as color( Blink LMagenta on Black )
  339. cls begtype
  340. ╔═════════════════════════════════════════════════════════════════════════════╗
  341. ║    All sorts of screen attributes can be printed on the screen.          ║
  342. ║                                          ║
  343. ║   On monochrome display you see:          On color display you see:       ║
  344. ╚═════════════════════════════════════════════════════════════════════════════╝
  345.     ~Normal                   Red on Black~
  346.     ^High Intensity               High Intensity^
  347.     `Underlined                  Blue on Green`
  348.     &Blinking Normal              Blinking Light Magenta on Black&
  349.  
  350.             And many @other@ \84comb\82inat\84ions\07^!^
  351.  
  352.       ~Colors can even be ^nested^ or toggled `on` and `off`.~
  353. ╔═════════════════════════════════════════════════════════════════════════════╗
  354. ║   EBL PLUS  allows this control of screen attributes through the use of     ║
  355. ║   the COLORCHAR command.  Colors can be nested, toggled, turned off          ║
  356. ║   individually or as a group.  The alternative \\hex format can still        ║
  357. ║   be used as well.                                  ║
  358. ╚═════════════════════════════════════════════════════════════════════════════╝
  359. end
  360. colorchar
  361. colorchar '@' as color( white on blue )
  362. ansi
  363. color yellow on cyan
  364. begtype
  365. Users of ANSI.SYS can also control colors & the display.
  366.  
  367. Press any key to continue. . .
  368.  
  369. end
  370. color normal
  371. inkey
  372. IF %D = 'RAM' then RAM
  373. else BIOS
  374. cls
  375. -rd.name1
  376.     if .%F <> '.' skip 3
  377.     * notice a '.' will make sure that null entries can be found
  378.     read I didn't catch your first name, what was it? %F
  379.     goto -rd.name1
  380.     type OK, your first name is %F
  381.     -rd.name2
  382.     if .%L <> '.' skip 2
  383.     read I didn't catch your last name, what was it? %L
  384.     goto -rd.name2
  385.     cls begtype
  386.  
  387. I am using your name as two strings to work with.
  388.  
  389. Comparisons can be made . . .
  390. end
  391. if %F = %L type The strings are equal by name.
  392. if %F <> %L type
  393. begin
  394.     type The strings are not equal by name,
  395.     if %F # = %L # type but are equal in number of letters.
  396.     else type nor are they equal in number of letters.
  397. end
  398. type
  399. type Strings contents can be manipulated . . .
  400. type CONCATENATION.. They can be combined to form %F%L
  401. type CONCATENATION.. or to form" %L%F.
  402. /U | %I = %F $ 1 1
  403. %I = %I.%L $ 1 3   | /U-
  404. %H = %F #
  405. type SUBSTRINGS..... Your initials would be %I.
  406. type LENGTHS........ Your first name has %H letters.
  407. begtype
  408.  
  409. @════════════════════════════════════════════════════════════════════════════@
  410.   Strings can be up to 255 characters and may be passed back and forth
  411.   to DOS.  Flexible string operations and comparisons can be done as well.
  412.   There are 10 variables for strings which may operate with DOS, and 15
  413.   which can be used even between executing BAT programs.  There are another
  414.   6 variables which have predefined (fixed) contents to give status, etc.
  415.   BATXV is an external function provided to registered users. It can
  416.   contain extended variables and allows almost unlimited variable space.
  417.   It also allows flexible variable names, indexing, and array capabilities.
  418. @════════════════════════════════════════════════════════════════════════════@
  419.  
  420. Press any key to continue. . .
  421. end
  422. inkey
  423. return
  424.  
  425. *******************************************************************************
  426.  
  427. -exit    ********** Display final EXIT window ***********
  428.     locate 11 16            |* erase old bounce bar
  429.     color( yellow on red)
  430.     type " eXit                                   "
  431.  
  432.     color( white on blue )        |* setup new window w/ bounce bar
  433.     window( 18, 13, 48, 20)
  434.     type "Ready to leave EBL Plus demo!"
  435.     color Cyan on blue
  436.     type "Make selection & press ─┘"
  437.     type
  438.     colorchar . as color( yellow on blue)
  439.     type ". Exit . . Help . .Return."
  440.     colorchar
  441.     %A = ""
  442.     goto -End1
  443.  
  444. *******************************************************************************
  445.  
  446. bat -on.error-
  447. bat begtype
  448.  
  449.     Unexpected error \%S%R in line \%S%L !
  450.  
  451.     This batch file was error free when it was distributed
  452.     by Seaware. An error indicates that it was most likely
  453.     modified by someone improperly. To get an updated demo
  454.     diskette send $10 to Seaware directly or call 800/634-8188.
  455.  
  456.  
  457.  
  458.                Seaware Corp.
  459.            Post Office Box 1656
  460.            Delray Beach, FL 33444
  461. end
  462. exit
  463.  
  464. ***  Built Animated ASP Logo ***
  465. *   (Caution: Use of this routine is restricted to registered ASP Members only!)
  466. *
  467. -asplogo
  468. read %M %N
  469. *
  470. *  %M = logo x corner
  471. *  %N = logo y corner
  472. *
  473. *color( white on blue )
  474. window(%M,%N,(%M+39),(%N+10),b)
  475. begtype
  476.            (tm)
  477.  
  478. ─────────────────────────────────────
  479.  
  480.  
  481.  
  482. ─────────────────────────────────────
  483. end
  484. wait until time(1)
  485. window((%M+9),(%N+1),(%M+19),(%N+5),s)
  486. begtype
  487.  
  488.     o
  489.     ║
  490. ────╨
  491. end
  492. locate (%M+22) (%N+4) | type "Association of"
  493. wait until time(1)
  494. window((%M+3),(%N+2),(%M+13),(%N+6),s)
  495. begtype
  496.  
  497.     o
  498.     ║
  499. ────╨
  500. end
  501. locate (%M+9)  (%N+2) | type "┴"
  502. locate (%M+22) (%N+5) | type "Shareware"
  503. wait until time(1)
  504. window((%M+7),(%N+4),(%M+17),(%N+8),s)
  505. begtype
  506.  
  507.     o
  508.     ║
  509. ────╨
  510. end
  511. locate (%M+13) (%N+4) | type "┴╨"
  512. locate (%M+17) (%N+5) | type "├"
  513. locate (%M+7)  (%N+6) | type "┤"
  514. locate (%M+22) (%N+6) | type "Professionals"
  515. wait until time(1)
  516. locate (%M+22) (%N+8) | type "MEMBER"
  517. wait until time(1)
  518. return
  519.